<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
	<title>CRM-main</title>
	<%@ include file="include/head.jsp" %>
	<meta charset="UTF-8">
	<title></title>
</head>
<body class="crm">
	
	<jsp:include page="include/top.jsp">
		<jsp:param value="main" name="tag"/>
	</jsp:include>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span8">
				<div class="well screen">
					<div class="page-header header">
						<div class="right-links">
							显示
							<select id="type" name="type"><option value="">所有动态</option>
								<option value="schedule">任务动态</option>
								<option value="chance_note">机会动态</option>
								<option value="note">事件动态</option>
								<option value="email">邮件动态</option>
							</select>
							
							<script type="text/javascript" charset="utf-8">
								$('#type').change(function() {
									$('body').addClass('loading');
									$.get('/dashboard?filter=on&amp;page=1', {type: this.value}, function(data) {
										$('#activities').html(data);
										$('body').removeClass('loading');
									}, 'html');
								});
							</script>
						</div>
					最新动态

					</div>
					
					<div class="live_search_spinner" behavior="spinner" id="parties_loading">
					  <div class="liner">
					    <h3>处理中...</h3>
					    <img src="./img/indicator.gif" alt="wait">
					  </div>
					</div>
					
					<div class="main" id="main">
						<p>你在忙什么？记录与分享工作生活的点滴。</p>
						<div>
							<form accept-charset="UTF-8" action="#notes" class="simple_form new_note" data-remote="true" id="note-form" method="post" novalidate="novalidate">
								<input id="from" name="from" type="hidden" value="Dashboard">
								<input id="note_parent_id" name="note[parent_id]" type="hidden">
								<input id="note_contact_id" name="note[contact_id]" type="hidden" value="774147">
								<input id="note_deal_id" name="note[chance_id]" type="hidden">
		
								<div class="control-group text required">
									<div class="controls">
										<textarea class="text required content" cols="40" id="note_content" name="note[content]" rows="20"></textarea>
									</div>
								</div>	
									<div id="note_options" style="display:none; ">
										什么时候发生的？
										<input type="text" name="Time" id="time" onClick="Calendar('time')"  class=" span4" placeholder="请输入具体时间" >	
									</div>
								
								<div class="new_note_form_basics">
									<div class="submit right">
										<input class="btn btn-primary" data-loading-text="处理中.." name="commit" type="submit" value="保存">
									</div>
									<div class="action">
										<a href="#" id="show_options_link" onclick="show_options(); return false;">显示选项</a>
									</div>
								</div>
							</form>
						</div>

<script type="text/javascript" charset="utf-8">
	function show_options() {
		$('#note_options').show();
		$('#show_options_link').hide();
	}
  if(!Array.prototype.indexOf) {
		Array.prototype.indexOf = function(needle) {
			for(var i = 0; i < this.length; i++) {
				if(this[i] === needle) {
					return i;
				}
			}
			return -1;
		};
  }

	// auto_size_textarea('holder_', 'note_content_');  
	$(document).ready(function() {
		validate_form('#note-form', true);
		PendingAttachments.init(".attachment_container");
		// $('#note_content').focus()
		
	})
</script>


			<!-- 用于显示最新动态-->
				<div id="activities">
					<table id="activities" class="table crm-table top no-hover" style="margin-bottom: 60px">
						<tbody>

						</tbody>
					</table>
					
					

				<style>
				.meta {
					line-height: 26px;
				}
				.meta li span {
					padding: 4px 8px;
					font-weight:blod;
				}
				.meta	.nav-pills li a {
				  padding: 4px 8px;
				}
				.meta .nav {
					margin-bottom: 0px;
				}
				</style>

				<script>
					$(document).ready(function() {
						bind_regarding_event()
					});
				</script>


				</div>

				<style type="text/css" media="screen">
					#active-users {
						margin-top: 10px;
					}
					#active-users .user {
						display: inline-block;
						margin: 0px 5px 5px 0px;
						width: 32px;
						vertical-align: top;
					}
				</style>
					</div>
				</div>
			</div>
		<div class="span4 sidebar">
			<div id="tasks_div" class="well">
				<div class="title">
					<span>
						<a data-toggle="modal" href="#taskModal" data-backdrop="static">添加任务</a>
					</span>
					您的待办任务
				</div>
				<div id="upcoming_tasks">
					<div id="screen_body">
	
						<div class="tasks today">
							<legend>今天</legend>
								<div id="task_817110" class="task checkbox">
									<span class="task_hover">
											<div class="task_actions" style="display: none; ">
												<a href="#/task/delete" class="icon icon-trash" data-confirm="您确定要删除这个任务吗？" data-method="delete" data-remote="true" rel="nofollow" title="删除这个任务"></a>
												<a href="#task/edit" class="edit" data-remote="true">编辑</a>
											</div>	
										<input data-confirm="您确定要完成分配给 lxb66 的任务吗？" id="task_done_817110" name="task_done" onclick="done_task(817110, 6641, 6641)" type="checkbox" value="1">
										123
									</span>
								</div>
							</div>
						</div>
					</div>
				</div>
				
	<script type="text/javascript" charset="utf-8">
		$.get('/tasks', function(data) {
			$('#tasks_div').html(data);
			ContactQuickShow.init();
		}, 'html');
		$("#context").val("tasks");
	</script>

				</div>
			</div>
		</div>
</body>
</html>
